Skip to content

[Merged by Bors] - chore(Data/Tree/Basic): Rename Tree to BinaryTree#39707

Closed
sorrachai wants to merge 45 commits into
leanprover-community:masterfrom
sorrachai:rename_tree_to_binary_tree
Closed

[Merged by Bors] - chore(Data/Tree/Basic): Rename Tree to BinaryTree#39707
sorrachai wants to merge 45 commits into
leanprover-community:masterfrom
sorrachai:rename_tree_to_binary_tree

Conversation

@sorrachai

@sorrachai sorrachai commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Rename Tree to BinaryTree.

This frees up the name Tree to cover n-ary trees in future.

We only deprecate the defs, and move the theorems without deprecation.

@github-actions github-actions Bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label May 22, 2026
@github-actions

Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown

PR summary 9ab2f22441

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Data.Tree.Basic 58 59 +1 (+1.72%)
Mathlib.Data.Tree.Get 63 64 +1 (+1.59%)
Mathlib.Data.Tree.Traversable 101 102 +1 (+0.99%)
Import changes for all files
Files Import difference
3 files Mathlib.Data.Tree.Basic Mathlib.Data.Tree.Get Mathlib.Data.Tree.Traversable
1

Declarations diff (regex)

+ BinaryTree.{u}
+ Tree
+ Tree.nil.{u}
+ Tree.node.{u}
+ _root_.Tree.get
+ _root_.Tree.getOrElse
+ _root_.Tree.height
+ _root_.Tree.indexOf
+ _root_.Tree.left
+ _root_.Tree.map
+ _root_.Tree.numLeaves
+ _root_.Tree.numNodes
+ _root_.Tree.right
+ _root_.Tree.traverse
+ _root_.Tree.treesOfNumNodesEq
+ _root_.Tree.unitRecOn
+ instance : Inhabited (BinaryTree α)
+ instance : LawfulTraversable BinaryTree
+ instance : Traversable BinaryTree
- Tree.{u}
- instance : Inhabited (Tree α)
- instance : LawfulTraversable Tree
- instance : Traversable Tree

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 9ab2f22).

  • +65 new declarations
  • −50 removed declarations
+BinaryTree
+BinaryTree.below
+BinaryTree.brecOn
+BinaryTree.brecOn.eq
+BinaryTree.brecOn.go
+BinaryTree.casesOn
+BinaryTree.coe_treesOfNumNodesEq
+BinaryTree.comp_map
+BinaryTree.comp_traverse
+BinaryTree.ctorElim
+BinaryTree.ctorElimType
+BinaryTree.ctorIdx
+BinaryTree.get
+BinaryTree.getOrElse
+BinaryTree.height
+BinaryTree.height.eq_def
+BinaryTree.height_le_numNodes
+BinaryTree.id_map
+BinaryTree.indexOf
+BinaryTree.instInhabited
+BinaryTree.instLawfulTraversable
+BinaryTree.instTraversable
+BinaryTree.left
+BinaryTree.left_node_right_eq_self
+BinaryTree.map
+BinaryTree.map.eq_def
+BinaryTree.mem_treesOfNumNodesEq
+BinaryTree.mem_treesOfNumNodesEq_numNodes
+BinaryTree.naturality
+BinaryTree.nil
+BinaryTree.nil.elim
+BinaryTree.nil.sizeOf_spec
+BinaryTree.noConfusion
+BinaryTree.noConfusionType
+BinaryTree.node
+BinaryTree.node.elim
+BinaryTree.node.inj
+BinaryTree.node.injEq
+BinaryTree.node.noConfusion
+BinaryTree.node.sizeOf_spec
+BinaryTree.numLeaves
+BinaryTree.numLeaves.eq_def
+BinaryTree.numLeaves_eq_numNodes_succ
+BinaryTree.numLeaves_pos
+BinaryTree.numNodes
+BinaryTree.numNodes.eq_def
+BinaryTree.pairwiseNode
+BinaryTree.rec
+BinaryTree.recOn
+BinaryTree.right
+BinaryTree.traverse
+BinaryTree.traverse.eq_def
+BinaryTree.traverse_eq_map_id
+BinaryTree.traverse_pure
+BinaryTree.treesOfNumNodesEq
+BinaryTree.treesOfNumNodesEq.eq_def
+BinaryTree.treesOfNumNodesEq_card_eq_catalan
+BinaryTree.treesOfNumNodesEq_succ
+BinaryTree.treesOfNumNodesEq_zero
+BinaryTree.unitRecOn
+BinaryTree.«term_△_»
-Tree.below
-Tree.brecOn
-Tree.brecOn.eq
-Tree.brecOn.go
-Tree.casesOn
-Tree.coe_treesOfNumNodesEq
-Tree.comp_map
-Tree.comp_traverse
-Tree.ctorElim
-Tree.ctorElimType
-Tree.ctorIdx
-Tree.height.eq_def
-Tree.height_le_numNodes
-Tree.id_map
-Tree.instInhabited
-Tree.instLawfulTraversable
-Tree.instTraversable
-Tree.left_node_right_eq_self
-Tree.map.eq_def
-Tree.mem_treesOfNumNodesEq
-Tree.mem_treesOfNumNodesEq_numNodes
-Tree.naturality
-Tree.nil.elim
-Tree.nil.sizeOf_spec
-Tree.noConfusion
-Tree.noConfusionType
-Tree.node.elim
-Tree.node.inj
-Tree.node.injEq
-Tree.node.noConfusion
-Tree.node.sizeOf_spec
-Tree.numLeaves.eq_def
-Tree.numLeaves_eq_numNodes_succ
-Tree.numLeaves_pos
-Tree.numNodes.eq_def
-Tree.pairwiseNode
-Tree.rec
-Tree.recOn
-Tree.traverse.eq_def
-Tree.traverse_eq_map_id
-Tree.traverse_pure
-Tree.treesOfNumNodesEq.eq_def
-Tree.treesOfNumNodesEq_card_eq_catalan
-Tree.treesOfNumNodesEq_succ
-Tree.treesOfNumNodesEq_zero
-Tree.«term_△_»
+instDecidableEqBinaryTree
+instDecidableEqBinaryTree.decEq
-instDecidableEqTree
-instDecidableEqTree.decEq
+instReprBinaryTree
+instReprBinaryTree.repr
-instReprTree
-instReprTree.repr

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 9ab2f22441
Reference commit d90090f647

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

Comment thread Mathlib/Data/Tree/Basic.lean
Comment thread Mathlib/Data/Tree/Basic.lean
Comment thread Mathlib/Data/Tree/Basic.lean Outdated
Comment thread Mathlib/Data/Tree/Basic.lean Outdated
sorrachai and others added 4 commits May 22, 2026 17:32
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Comment thread Mathlib/Data/Tree/Basic.lean
Comment thread Mathlib/Data/Tree/Basic.lean Outdated
Comment thread Mathlib/Data/Tree/Get.lean
Comment thread Mathlib/Data/Tree/Basic.lean Outdated
Comment thread Mathlib/Data/Tree/Basic.lean Outdated
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Comment thread Mathlib/Data/Tree/Basic.lean Outdated
@eric-wieser
eric-wieser temporarily deployed to cache-upload-forks June 8, 2026 02:21 — with GitHub Actions Inactive
@eric-wieser
eric-wieser temporarily deployed to cache-upload-forks June 8, 2026 02:51 — with GitHub Actions Inactive
@sorrachai

Copy link
Copy Markdown
Collaborator Author

Should I change anything?

Comment thread Mathlib/Combinatorics/Enumerative/Catalan/Tree.lean Outdated
@eric-wieser
eric-wieser temporarily deployed to cache-upload-forks June 8, 2026 14:45 — with GitHub Actions Inactive
@eric-wieser
eric-wieser temporarily deployed to cache-upload-forks June 8, 2026 16:16 — with GitHub Actions Inactive
@github-actions github-actions Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 8, 2026
@eric-wieser

Copy link
Copy Markdown
Member

bors merge

Thanks!

@mathlib-bors

mathlib-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

👎 Rejected by label

@mathlib-triage mathlib-triage Bot added the ready-to-merge This PR has been sent to bors. label Jun 8, 2026
@eric-wieser eric-wieser removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 8, 2026
@eric-wieser

Copy link
Copy Markdown
Member

bors merge

mathlib-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
Rename `Tree` to `BinaryTree`.

This frees up the name `Tree` to cover n-ary trees in future.

We only deprecate the `def`s, and move the theorems without deprecation.

Co-authored-by: Eric Wieser <efw@google.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@eric-wieser
eric-wieser temporarily deployed to cache-upload-forks June 8, 2026 19:10 — with GitHub Actions Inactive
@mathlib-bors

mathlib-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore(Data/Tree/Basic): Rename Tree to BinaryTree [Merged by Bors] - chore(Data/Tree/Basic): Rename Tree to BinaryTree Jun 8, 2026
@mathlib-bors mathlib-bors Bot closed this Jun 8, 2026
kim-em added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jun 9, 2026
`Tree` was renamed to `BinaryTree` in leanprover-community#39707, but `docs/overview.yaml`
still referred to the old name, failing the check-yaml post-build step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
xroblot pushed a commit to xroblot/mathlib4 that referenced this pull request Jun 13, 2026
…ty#39707)

Rename `Tree` to `BinaryTree`.

This frees up the name `Tree` to cover n-ary trees in future.

We only deprecate the `def`s, and move the theorems without deprecation.

Co-authored-by: Eric Wieser <efw@google.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
ReemMelamed pushed a commit to ReemMelamed/mathlib4 that referenced this pull request Jun 20, 2026
…ty#39707)

Rename `Tree` to `BinaryTree`.

This frees up the name `Tree` to cover n-ary trees in future.

We only deprecate the `def`s, and move the theorems without deprecation.

Co-authored-by: Eric Wieser <efw@google.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! ready-to-merge This PR has been sent to bors. t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants